package cn.crc.web.usertask;

import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

//@Configuration
//@EnableScheduling
public class TaskExecutorConfig {
    @Bean
    public ThreadPoolTaskExecutor taskExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(1);//10
        executor.setMaxPoolSize(1);//50
        executor.setQueueCapacity(2);//1000
        executor.setKeepAliveSeconds(60);//60
        executor.setThreadNamePrefix("task-executor-");
        return executor;
    }
}
